/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponseBoolean } from "../models/BaseResponseBoolean";
import type { BaseResponsePageQuestionSubmit } from "../models/BaseResponsePageQuestionSubmit";
import type { BaseResponsePageQuestionSubmitVO } from "../models/BaseResponsePageQuestionSubmitVO";
import type { BaseResponseQuestionSubmitVO } from "../models/BaseResponseQuestionSubmitVO";
import type { BaseResponseString } from "../models/BaseResponseString";
import type { QuestionSubmitAddRequest } from "../models/QuestionSubmitAddRequest";
import type { QuestionSubmitQueryRequest } from "../models/QuestionSubmitQueryRequest";
import type { QuestionSubmitVOQueryRequest } from "../models/QuestionSubmitVOQueryRequest";

import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
import { BaseResponseLong } from "../models/BaseResponseLong";
import type { QuestionEditRequest } from "../models/QuestionEditRequest";
import type { DeleteRequest } from "../models/DeleteRequest";
import { BaseResponseListLeast5TimeSubmitVO } from "../models/BaseReponseListLeast5TimeSubmitVO";
import { BatchDeleteRequest } from "../models/BatchDeleteRequest";

export class QuestionSubmitControllerService {
  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static submit(
    requestBody: QuestionSubmitAddRequest
  ): CancelablePromise<BaseResponseLong> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question_submit/submit",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponsePageQuestionSubmit OK
   * @throws ApiError
   */
  public static pageQueryQuestionSubmit(
    requestBody: QuestionSubmitQueryRequest
  ): CancelablePromise<BaseResponsePageQuestionSubmit> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question_submit/page",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponsePageQuestionSubmitVO OK
   * @throws ApiError
   */
  public static pageQueryQuestionSubmitVo(
    requestBody: QuestionSubmitVOQueryRequest
  ): CancelablePromise<BaseResponsePageQuestionSubmitVO> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question_submit/page/vo",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @returns BaseResponseListQuestionSubmitVO OK
   * @throws ApiError
   */
  public static getLeast5TimesSubmit(
    userId: number
  ): CancelablePromise<BaseResponseListLeast5TimeSubmitVO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/question_submit/least5",
      query: {
        userId: userId,
      },
    });
  }

  /**
   * @param userId
   * @param questionId
   * @returns BaseResponseString OK
   * @throws ApiError
   */
  public static getHistoryCode(
    userId: number,
    questionId: number
  ): CancelablePromise<BaseResponseString> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/question_submit/history",
      query: {
        userId: userId,
        questionId: questionId,
      },
    });
  }

  /**
   * @param id
   * @returns BaseResponseQuestionSubmitVO OK
   * @throws ApiError
   */
  public static getQuestionSubmitVoById(
    id: number
  ): CancelablePromise<BaseResponseQuestionSubmitVO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/question_submit/get/vo",
      query: {
        id: id,
      },
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static updateQuestionSubmit(
    requestBody: QuestionEditRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "PUT",
      url: "/question_submit",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static deleteQuestionSubmit(
    requestBody: DeleteRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/question_submit",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static batchDeleteQuestionSubmits(
    requestBody: BatchDeleteRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/question_submit/batchDelete",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static cleanQuestionSubmit(): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/question_submit/clean",
      mediaType: "application/json",
    });
  }
}
